package com.hjy.scheduled.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class TaskController {

    @Autowired
    private AsyncTask asyncTask;

    @GetMapping(value = "/test")
    public String testAsync() {
        /*
            123-->异步,132-->同步
         */
        System.out.println("1");
        asyncTask.async();
        System.out.println("2");
        return "test";
    }
}
